package com.mall.seckill.mapper;

import com.mall.seckill.model.SeckillActivity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Darren
 * @since 2022-09-28
 */
@Mapper
public interface SeckillActivityMapper extends BaseMapper<SeckillActivity> {

    /**
     * 有效活动列表
     */
    @Select("SELECT * FROM seckill_activity WHERE end_time > NOW() ORDER BY start_time ASC LIMIT 5")
    List<SeckillActivity> validActivity();

}
